Completion Pad Mode
Pad mode lets customers choose which completion wells the app should display: the full pad, the active frac/wireline/pumpdown well, a custom well, or a SimulFrac line when enabled.
Use the selection model provided by corva-ui. Do not create a second pad-mode setting with different keys or behavior.
Automatic selector in AppHeader
For a completion app, AppHeader shows pad mode automatically when the context contains a fracFleet and a non-empty wells collection and the dashboard is not already scoped to one well.
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
export default function App() {
return (
<AppContainer header={<AppHeader />}>
<CompletionContent />
</AppContainer>
);
}
Set padModeDisabled only when the application intentionally does not support the standard completion selection:
<AppContainer header={<AppHeader padModeDisabled />}>
<CompletionContent />
</AppContainer>
Read the wells selected by pad mode
The header stores the selection in appSettings.settingsByAsset. Use usePadSelectorSelectedWells to apply the same logic to the body of the app:
import { useAppCommons, usePadSelectorSelectedWells } from '@corva/ui/effects';
export function CompletionContent() {
const {
fracFleet,
well,
wells = [],
appSettings = {},
} = useAppCommons();
const padId = Number(appSettings.padId ?? fracFleet?.current_pad_id ?? 0);
const selectedWells = usePadSelectorSelectedWells({
padId,
well,
wells,
fracFleet: fracFleet ?? null,
settingsByAsset: appSettings.settingsByAsset ?? {},
});
return (
<ul>
{selectedWells.map(item => (
<li key={item.id}>{item.name}</li>
))}
</ul>
);
}
On a single-well dashboard, the hook returns [well]. On a multi-well dashboard, it resolves the selected mode against the fleet's pad and line relationships.
Render the selector somewhere else
PadModeSelect is available from @corva/ui/componentsV2 when the app design requires it outside AppHeader:
import { PadModeSelect } from '@corva/ui/componentsV2';
<PadModeSelect />
Do not render both the automatic header selector and a second selector. Pass padModeDisabled to AppHeader when placing PadModeSelect elsewhere.
Manifest options
The selected modes depend on these application.ui fields:
| Field | Effect |
|---|---|
completionAppType | Defines pad, frac, wireline, pumpdown, single-well, and multi-well choices |
enableSimulFracInPadSelect | Adds line selection using frac_fleet_lines |
disableActiveWellsInPadSelect | Disables wells that are not active |
The default type is Frac Multi-Well Apps. See Build a Completion UI App for the complete list.
Local development
In local development, Corva UI stores the current pad-mode selection in local storage using an app- and asset-specific key. This prevents periodic local app-settings polling from overwriting the developer's selection.
Test at least these contexts:
- One selected completion well.
- A frac fleet with wells but no SimulFrac lines.
- A frac fleet with SimulFrac line relationships.
- Switching pads or frac fleets.
- No wells available.